<!DOCTYPE html>
<html>
<head>
     <title>淘宝商家_明细</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="X-UA-Compatible" content="chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
	
	<link rel="stylesheet" type="text/css" href="/lib/iview/iview.css">
	<link rel="stylesheet" type="text/css" href="/css/global.css">
	
	<script type="text/javascript" src="/js/vue.js"></script>
	<script type="text/javascript" src="/js/zepto.min.js"></script>
	<script type="text/javascript" src="/lib/iview/iview.min.js"></script>
	<script type="text/javascript" src="/js/vue-components.js"></script>
	<script type="text/javascript" src="/js/public.js"></script>
</head>
<body>
<div id="app">
    <i-form ref="myForm" :model="myform" :rules="ruleValidate" :label-width="80">
        <Form-item label="title" prop="title">
            <i-input v-model="myform.title" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="sdesc" prop="sdesc">
            <i-input v-model="myform.sdesc" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="bulletin" prop="bulletin">
            <i-input v-model="myform.bulletin" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="mainpage" prop="mainpage">
            <i-input v-model="myform.mainpage" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="nick" prop="nick">
            <i-input v-model="myform.nick" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="main_cid" prop="mainCid">
            <i-input v-model="myform.mainCid" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="main_cname" prop="mainCname">
            <i-input v-model="myform.mainCname" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="seller_credit" prop="sellerCredit">
            <i-input v-model="myform.sellerCredit" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="shop_createtime" prop="shopCreatetime">
            <i-input v-model="myform.shopCreatetime" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="shop_area" prop="shopArea">
            <i-input v-model="myform.shopArea" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="shop_score" prop="shopScore">
            <i-input v-model="myform.shopScore" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="item_score" prop="itemScore">
            <i-input v-model="myform.itemScore" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="service_score" prop="serviceScore">
            <i-input v-model="myform.serviceScore" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="delivery_score" prop="deliveryScore">
            <i-input v-model="myform.deliveryScore" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="shop_type" prop="shopType">
            <i-input v-model="myform.shopType" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="create_Time" prop="createTime">
            <i-input v-model="myform.createTime" placeholder="请输入"></i-input>
        </Form-item>
        <Form-item label="update_Time" prop="updateTime">
            <i-input v-model="myform.updateTime" placeholder="请输入"></i-input>
        </Form-item>
    </i-form>
</div>
<script>


    const urls = {
        query:'/api/taobao/tbshop/query'
        ,save:'/api/taobao/tbshop/save'
    };

    let vm = new Vue({
        el: '#app',
        data() {
            return {
                myform: {
                    isState:true,
                    state: 1,
                    id:null//主键
                },
                ruleValidate: {
                    //prodId: [
                    //    {required: true, message: '产品ID不能为空', trigger: 'blur'}
                    //]
                }
            }
        },
        created(){
            if (PB.getPara('id')) {
                this.myform.id = PB.getPara('id');
                this.loadData();
            }
        },
        methods: {
            loadData(){
                let that = this;
                PB.ajax({url:urls.query,data:this.myform}, function (d) {
                    that.myform = d.data;
                    //that.myform.isState = !!that.myform.state;
                });
            },
            save () {
                this.$refs['myForm'].validate((valid) => {
                    if (valid) {
                        PB.ajax({url:urls.save,data:this.myform}, function (d) {
                            PB.formPageSaveOK(d);
                            });
                    } else {
                        PB.alert('表单验证失败!');
                        PB.formPageSaveError();
                    }
                })
            }
        }
    });


    function save() {
        vm.save();
    }

</script>
</body>
</html>
